package com.ad_hccm.dao.DiseaseHistory;

import com.ad_hccm.domain.DiseaseHistory.DiseaseHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 疾病史Dao
 */
@Mapper
public interface DiseaseHistoryDao {
    @Insert("insert into disease_history value(#{id}, #{firstDisease}, #{diseaseCourse}, #{site}, #{season}, #{isAdFamilyHistory})")
    public boolean save(DiseaseHistory diseaseHistory);

    @Update("update disease_history set firstDisease = #{firstDisease}, diseaseCourse = #{diseaseCourse}, site = #{site}, season = #{season}, isAdFamilyHistory = #{isAdFamilyHistory} where id=#{id}")
    public boolean update(DiseaseHistory diseaseHistory);

    @Select("select * from disease_history where id=#{id}")
    public DiseaseHistory getById(String id);

    @Select("select * from disease_history")
    public List<DiseaseHistory> getAll();
}